<div class="grid-24">
  <?php if (Yii::app()->user->hasFlash('success')): ?>
    <div class="notify notify-success">
      <a href="javascript:;" class="close">×</a>
      <?php echo Yii::app()->user->getFlash('success'); ?>
    </div>
  <?php endif; ?>

  <?php
  $this->renderPartial('_search', array(
      'model' => $searchModel,
      'searchData' => $searchData,
  ));
  ?>

  <div class="widget widget-table">
    <div class="widget-header">
      <span class="icon-list"></span>
      <h3 class="icon chart">Danh sach member</h3>

    </div>

    <div class="widget-content">
      <div class="dataTables_wrapper">
        <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
          <div class="dataTables_filter">
            <a href="<?php echo Yii::app()->createUrl('admin/members/create'); ?>" >
              <button class="btn btn-small btn-success">
                <span class="icon-plus"></span><?php echo Yii::t('main', 'button.add'); ?>
              </button>
            </a>
          </div>
        </div>

        <table class="table table-bordered table-striped">
          <thead>
            <tr>
              <th class="" width="6%">
                <?php echo $sort->extLink('member_id', "Id", array('class' => 'float_left')); ?>
              </th>
              <th class="" width="8%">
                <?php echo $sort->extLink('name', "Name", array('class' => 'float_left')); ?>
              </th>
              <th class="" width="7%">
                <?php echo $sort->extLink('member_type', "Type", array('class' => 'float_left')); ?>
              </th>
              <th class="" width="15%">
                <?php echo $sort->extLink('nickname', "AccountName", array('class' => 'float_left')); ?>
              </th>
              <th class="" width="">
                <?php echo $sort->extLink('mac_address', "Mac Address", array('class' => 'float_left')); ?>
              </th>
              <th class="" width="9%">
                <?php echo $sort->extLink('status', "Status", array('class' => 'float_left')); ?>
              </th>
              <th class="" width="6%">
                <a href="#"><?php echo "Parent"; ?></a>
              </th>
              <th class="" width="16%">
              </th>
            </tr>
          </thead>
          <tbody>
            <?php $i = 1; ?>
            <?php foreach ($models as $model): ?>
              <tr class="gradeA">
                <td class="center"><?php echo CHtml::encode($model->member_id); ?></td>
                <td class="">
                  <a href="<?php echo Yii::app()->createUrl('admin/accounts/list', array('memberId' => $model->member_id) + $_GET); ?>">
                    <?php echo $model->name; ?>
                  </a>
                </td>
                <td class=""><?php echo $memberTypes[$model->member_type]; ?></td>
                <td class=""><?php echo $model->nickname; ?></td>
                <td class=""><?php echo $model->mac_address; ?></td>
                <td class="text_center"><?php echo $statusList[$model->status]; ?></td>
                <td class=""><?php echo $model->parent_member_id; ?></td>
                <td class="text_center">
                  <a href="<?php echo Yii::app()->createUrl('admin/members/update', array('id' => $model->member_id) + $_GET); ?>">
                    <button class="btn btn-small btn-warning">
                      <span class="icon-pen"></span><?php echo Yii::t('main', 'button.edit'); ?>
                    </button>
                  </a>
                  <button class="btn btn-small btn-error" type="button" onclick="return memberPage.remove('<?php echo Yii::app()->createUrl('admin/members/delete', array('id' => $model->member_id)); ?>')">
                    <span class="icon-minus"></span><?php echo Yii::t('main', 'button.delete'); ?>
                  </button>
                </td>
              </tr>
              <?php $i++; ?>
            <?php endforeach; ?>
          </tbody>
        </table>
        <?php $this->renderPartial('../units/_pager', array('pages' => $pages, 'countData' => count($models))); ?>
      </div>
    </div>
    <!-- .widget-content -->

  </div>
  <!-- .widget -->

</div>

<?php
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile(Yii::app()->baseUrl . '/js/members.js');
?>